package com.siemens.exercise;
import java.util.ArrayList;

//multiply 
public class MultiplyExecute implements Command{
	
	@Override
	public int calc(String s) throws NegtiveNumException {
		ArrayList<Integer> arrayNumbers = StringFilter.getNumbers(s);
	
		int result=arrayNumbers.get(0);
		for (int i = 1; i<arrayNumbers.size(); i++) {
			result *= arrayNumbers.get(i);
		}
		return result;
	}

}